package com.pulyka.rtpvp.engine.client.web.ui.client.gameview;

public class ViewMath {

	public static boolean isPointInRectangle(double pointX, double pointY, double x, double y, double width, double height){
		if(pointX >= x && pointX <= x + width && pointY >= y && pointY <= y+height)
			return true;
		return false;
	}
	
	public static double[] getXYComponentOfTheta(double theta){
		return new double[]{Math.cos(theta), Math.sin(theta)};
	}
	
	public static double getTheta(double x, double y){
		return  Math.atan2(y, x);
	}
	
	public static Vector2d addVectors(Vector2d one, Vector2d other){
		Vector2d newVector2d = new Vector2d(one);
		newVector2d.add(other);
		return newVector2d;
	}
	
	public static Vector2d scalarMultiplyVector(Vector2d one, double scalar){
		Vector2d newVector2d = new Vector2d(one);
		newVector2d.multiply(scalar);
		return newVector2d;
	}
}
